;#############################
;https://stackoverflow.com/questions/31234395/why-use-rip-relative-addressing-in-nasm
;命令：
;nasm -f elf64 day10_0printf_1remove_no_pie.asm -o main.o && gcc main.o -o main -lc && ./main
;输出：
;Hello, World! This is printf! Already remove -no-pie!
;#############################
extern printf

section .data
	msg: db `Hello, World! This is printf! Already remove -no-pie!\n`, 0

section .text
	global main

main:
	push rbp
	mov rbp, rsp

;#####################################################################
	;rip-relative addressing
	;rel = relative address
	;meaning lea rsi, [rip + (msg - nextInstruction)]
	lea rdi, [rel msg]
	call printf wrt ..plt

;#####################################################################

	mov eax, 0
	leave
	ret
